<template>
  <!-- 添加或修改项目基础信息管理对话框 -->
  <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" append-to-body width="90%">

      <!-- <el-tabs  type="card" > -->
        <!--<el-tabs class="detail-tab" type="card" v-model="activeName">-->

           <!-- <project-invoice-detail-list :projectId="form.id"
                                         ref="ProjectInvoiceInfoListForPrjForm"></project-invoice-detail-list>-->
            <div class="app-container">
              <el-table border v-loading="loading" :data="dataList"  @selection-change="handleSelectionChange">
                <el-table-column label="序号" align="center" type="index"/>
                <el-table-column label="发票编号" align="center" prop="apply.no"/>
                <el-table-column label="开票金额" align="center" prop="amount"/>
                <el-table-column label="开票日期" align="center" prop="apply.invoiceDate" width="180">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.apply.invoiceDate, '{y}-{m}-{d}') }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="备注信息" align="center" prop="remark" show-overflow-tooltip/>
                <!--<el-table-column align="center" label="开票文件" prop="apply.invoiceFile" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <file-upload-show :value="scope.row.apply.invoiceFile"></file-upload-show>
                  </template>
                </el-table-column>-->

                <!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
                <!--        <template slot-scope="scope">-->
                <!--          <el-button size="mini" type="text" icon="el-icon-view"-->
                <!--                     @click="fapiaomingxi(scope.row)" v-hasPermi="['develop:GoodsInvoice:edit']">发票明细-->
                <!--          </el-button>-->
                <!--        </template>-->
                <!--      </el-table-column>-->
              </el-table>
              <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum"
                          :limit.sync="queryParams.pageSize" @pagination="getList"/>
             </div>

        <!--</el-tabs>-->
      <!-- </el-tabs> -->
    <div class="dialog-footer" slot="footer">
      <el-button @click="cancel">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { addAction, getAction, getById, updateAction} from '@/api/manage'

export default {
  name: "TaxAllFormShowList",
  dicts: ['goods_customer', 'company', 'yes_no', 'yewu_type','invoice_back_status'],
  components: {
  },
  data() {
    return {
      title: "项目开票信息",
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      activeName: "first",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
      dataList: [],
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        projectId: null,
        projectName: null
      },
      url: {
        list: '/goodsInvoiceApplyDetail/goodsInvoiceApplyDetail/list',
      },
      type2: "2",
      type3: "3",
      // 部门树选项
      deptOptions: [],
    };
  },
  created() {

  },
  methods: {
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    sheowTaxAll(row) {
      /*this.reset();
      const id = row.id || this.ids;
      getById(this.url.getById, id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "项目开票信息";
      });*/
      this.open = true;
      this.queryParams.projectId = row.id;
      this.getList();
    },
   getList() {
     this.loading = true;
     getAction(this.url.list, this.queryParams).then(response => {
       this.dataList = response.rows;
       this.total = response.total;
       this.loading = false;
     });
   },
    // 取消按钮
    cancel() {
      this.open = false;
    },

  }
};
</script>
